import './assets/styles/main.scss'
import 'vant/lib/index.css'; // 引入样式文件
import '@/framework/config'
import DateUtil from '@/framework/date-util'

//import {apiServices} from '@/api/index'
//(globalThis as any).apiService = apiService;



import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'

import Vant from 'vant'; // 引入 Vant 组件库

const app = createApp(App)

app.use(createPinia())
app.use(router)
app.use(Vant)

// 设置过滤器
app.config.globalProperties.$filters = {
    // 日期格式化
    date(value:any, format?:string) {
        if(!value){
            return ''
        }
        format = format || 'yyyy-MM-dd'
        const date = DateUtil.toDate(value)
        return DateUtil.format(date, format)
    },

    // 时间格式化
    datetime(value:any, format?:string) {
        if(!value){
            return ''
        }
        format = format || 'yyyy-MM-dd HH:mm:ss'
        const date = DateUtil.toDate(value)
        return DateUtil.format(date, format)
    }

}

app.mount('#app')
